package com.mdd.entity1;

import java.util.List;

import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Table;

import org.hibernate.annotations.IndexColumn;
@Entity
@Table
public class Code {
	String code;
	String name;
	List<CodeDetail> codes;
	@Id
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@ElementCollection(targetClass = CodeDetail.class)
	@JoinTable(name = "CODE_DETAIL", joinColumns = { @JoinColumn(name = "CODE_ID") })
	@IndexColumn(name = "linenum")
	public List<CodeDetail> getCodes() {
		return codes;
	}
	public void setCodes(List<CodeDetail> codes) {
		this.codes = codes;
	}
	
	
	
}
